{% extends 'layout.html' %}

{% block content %}
    <div style="margin-bottom: 5px">
        <a href="{% url 'level_add' %}" class="btn btn-success"><span class="glyphicon glyphicon-plus-sign"></span>
            新建</a>
    </div>
    <table class="table table-bordered">
        <thead>
        <tr>
            <th>ID</th>
            <th>标题</th>
            <th>折扣</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {% for row in queryset %}
            <tr>
                <td>{{ row.id }}</td>
                <td>{{ row.title }}</td>
                <td>{{ row.percent }}%</td>
                <td>
                    <a href="{% url 'level_edit' pk=row.id %}" class="btn btn-primary btn-xs">编辑</a>
                    <a href="{% url 'level_delete' pk=row.id %}" class="btn btn-danger btn-xs">删除</a>
                </td>
            </tr>
        {% endfor %}

        </tbody>
    </table>

{% endblock %}
